package com.uah;

import java.util.ArrayList;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.Marker;
import com.google.android.gms.maps.model.MarkerOptions;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.Toast;

import com.google.android.gms.maps.SupportMapFragment;

public class Maps extends FragmentActivity {
	
	private GoogleMap myMap;
	
	// the lat/long coordinates for each location
	static final LatLng FITNESS_CENTER = new LatLng(34.726588,-86.636724);
	static final LatLng NORTH_RESIDENCE_HALL = new LatLng(34.733783,-86.639879);
	static final LatLng FRANK_FRANZ = new LatLng(34.733316,-86.640705);
	static final LatLng MORTON = new LatLng(34.732699,-86.641552);
	static final LatLng UG_GALLERY = new LatLng(34.73187,-86.642003);
	static final LatLng CC_HOTEL = new LatLng(34.731297,-86.642969);
	static final LatLng UNIVERSITY_CENTER = new LatLng(34.730865,-86.641499);
	static final LatLng CC_RESIDENCE_HALL = new LatLng(34.730018,-86.641746);
	static final LatLng WILSON = new LatLng(34.729154,-86.641316);
	static final LatLng BA = new LatLng(34.728255,-86.641456);
	static final LatLng LIBRARY = new LatLng(34.729692,-86.640007);
	static final LatLng ROBERTS = new LatLng(34.730953,-86.638634);
	static final LatLng NURSING = new LatLng(34.729745,-86.638527);
	static final LatLng SOCCER = new LatLng(34.728696,-86.636714);
	static final LatLng FRAT = new LatLng(34.725248,-86.635641);
	static final LatLng SE_HOUSING = new LatLng(34.724446,-86.637046);
	static final LatLng PARKING_DECK = new LatLng(34.726192,-86.638591);
	static final LatLng PAPA_JOHNS = new LatLng(34.725618,-86.638623);
	static final LatLng CHARGER_VILLAGE = new LatLng(34.724728,-86.638645);
	static final LatLng CREDIT_UNION = new LatLng(34.723493,-86.637894);
	static final LatLng OPTICS = new LatLng(34.722761,-86.638516);
	static final LatLng MATERIALS_SCIENCE = new LatLng(34.722285,-86.638237);
	static final LatLng ADMISSIONS = new LatLng(34.722876,-86.640587);
	static final LatLng ENGINEERING = new LatLng(34.722594,-86.640469	);
	static final LatLng VON_BRAUN = new LatLng(34.721289,-86.64078);
	static final LatLng MADISON = new LatLng(34.723934,-86.64122);
	static final LatLng SHELBY = new LatLng(34.725839,-86.641177);
	static final LatLng SHELBIE_HALL = new LatLng(34.718414,-86.645157);
	static final LatLng TECH = new LatLng(34.719022,-86.646477);
	static final LatLng CRAMER = new LatLng(34.724631,-86.644953);
	static final LatLng SPRAGINS = new LatLng(34.731226,-86.636692);
	static final LatLng BUSINESS_SERVICES = new LatLng(34.718881,-86.640233);
	static final LatLng RADIO = new LatLng(34.718916,-86.639332);
	static final LatLng AUDITORIUM = new LatLng(34.728105,-86.641123);
	static final LatLng WILSON_THEATRE = new LatLng(34.729075,-86.641767);
	static final LatLng SLAB = new LatLng(34.729974,-86.640791);
	static final LatLng EXHIBIT_HALL = new LatLng(34.73083,-86.641628);
	static final LatLng BOOKSTORE = new LatLng(34.730838,-86.641306);
	static final LatLng VISITORS_CENTER = new LatLng(34.731315,-86.641488);
	static final LatLng STUDIO_106 = new LatLng(34.732452,-86.641424);
	static final LatLng RECITAL_HALL = new LatLng(34.730927,-86.639149);
	
	ArrayList<Marker> markers = new ArrayList<Marker>();	// all of the markers that are shown on the map
	boolean itemSelected = false;							// shows whether or not a location has been chosen
	Marker lastLocation;									// stores the marker value of the chosen location (for navigation)
	GPSTracker gps;											// handles all GPS interactions
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.maps);
	    myMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
	    
	    // add markers to the list
	    markers.add(myMap.addMarker(new MarkerOptions()
	    	.position (FITNESS_CENTER)
	    	.title(this.getString(R.string.menu_univFitCenter))));
	    markers.add(myMap.addMarker(new MarkerOptions()
			.position (NORTH_RESIDENCE_HALL)
			.title("North Campus Residence Hall")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (FRANK_FRANZ)
    		.title("Frank Franz Residence Hall")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (MORTON)
    		.title("Morton Hall")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (UG_GALLERY)
    		.title("Union Grove Gallery & Meeting Hall")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (CC_HOTEL)
    		.title("Conference Center and Hotel")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (UNIVERSITY_CENTER)
    		.title("University Center")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (CC_RESIDENCE_HALL)
    		.title("Central Campus Residence Hall")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (WILSON)
    		.title("Wilson Hall")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (BA)
    		.title("Business Administration Building")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (LIBRARY)
    		.title("Salmon Library")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (ROBERTS)
    		.title("Roberts Hall")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (NURSING)
    		.title("Nursing Building")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (SOCCER)
    		.title("Soccer Field")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (FRAT)
    		.title("Fraternity/Sorority Row")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (SE_HOUSING)
    		.title("Southeast Campus Housing")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (PARKING_DECK)
    		.title("Parking Deck/Public Safety")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (PAPA_JOHNS)
    		.title("Papa John's/Chic-Fil-A")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (CHARGER_VILLAGE)
    		.title("Charger Village")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (CREDIT_UNION)
    		.title("Alabama Credit Union")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (OPTICS)
    		.title("Optics Building")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (MATERIALS_SCIENCE)
    		.title("Materials Science Building")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (ADMISSIONS)
    		.title("Admissions")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (ENGINEERING)
    		.title("Engineering Building")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (VON_BRAUN)
    		.title("Von Braun Research Hall")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (MADISON)
    		.title("Madison Hall")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (SHELBY)
    		.title("Shelby Center")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (SHELBIE_HALL)
    		.title("Shelbie King Hall")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (TECH)
    		.title("Olin B. King Technology Hall")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (CRAMER)
    		.title("Bud Cramer Research Hall")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (SPRAGINS)
    		.title("Spragins Research Hall")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (BUSINESS_SERVICES)
    		.title("Business Services")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (RADIO)
    		.title("WLRH Public Radio")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (AUDITORIUM)
    		.title("Chan Auditorium")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (WILSON_THEATRE)
    		.title("Wilson Theatre")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (SLAB)
    		.title("The Slab Outside Stage")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (EXHIBIT_HALL)
    		.title("Exhibit Hall")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (BOOKSTORE)
    		.title("UAHuntsville Bookstore")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (ADMISSIONS)
    		.title("Admissions Visitor's Center")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (STUDIO_106)
    		.title("Studio 106")));
	    markers.add(myMap.addMarker(new MarkerOptions()
    		.position (ROBERTS)
    		.title("Roberts Recital Hall")));
	    
	    // add the markers to the map
	    for(Marker marker : markers)
	    {
	    	//myMap.addMarker(marker);
	    	myMap.addMarker(new MarkerOptions()
				.position (marker.getPosition())
				.title(marker.getTitle()));
	    }
	    gps = new GPSTracker(Maps.this);
	}
	
	// shows the menu
	@Override
	public boolean onCreateOptionsMenu(Menu menu)
	{    
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.map_locations, menu);
		return true;
	}
	
	// shows or hides the menu options that are relevant
	@Override
	public boolean onPrepareOptionsMenu(Menu menu)
	{
	    MenuItem goTo = menu.findItem(R.id.menu_goTo);
	    MenuItem showAll = menu.findItem(R.id.show_all);
	    MenuItem clearAll = menu.findItem(R.id.menu_clear_all);
		if(itemSelected)
		{
		    goTo.setVisible(true);
		    showAll.setVisible(false);
		    clearAll.setVisible(true);			
		}
		else
		{
		    goTo.setVisible(false);
		    showAll.setVisible(true);
		    clearAll.setVisible(true);
		}
			     
	    return true;
	}
	
	// event handler used when a menu item is selected
	@Override
	public boolean onOptionsItemSelected(MenuItem item)
	{
		
		switch (item.getItemId())
		{
			case R.id.menu_clear_all:
			{
				myMap.clear();
				itemSelected = false;
				return true;
			}
			case R.id.show_all:
			{
				for(Marker marker : markers)
				{
					myMap.addMarker(new MarkerOptions()
						.position (marker.getPosition())
						.title(marker.getTitle()));
				}
				itemSelected = false;
				return true;
			}
			case R.id.menu_goTo:
			{
				// get the user's current location
				double phoneLongitude = 0.0;
				double phoneLatitude = 0.0;
				
				if(gps.canGetLocation())
				{
					phoneLongitude = gps.getLongitude();
					phoneLatitude = gps.getLatitude();
					
					// get the coordinates of the location
					double longitude = lastLocation.getPosition().longitude;
					double latitude = lastLocation.getPosition().latitude;
					
					// launch the action that displays the directions
					Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://maps.google.com/maps?" + "saddr="+ phoneLatitude + "," + phoneLongitude + "&daddr=" + latitude + "," + longitude));
				    intent.setClassName("com.google.android.apps.maps","com.google.android.maps.MapsActivity");
				    startActivity(intent);
					
					 
				}
				else
				{
					gps.showSettingsAlert();
				}
				

				phoneLongitude = gps.getLongitude();
				phoneLatitude = gps.getLatitude();
				
				Toast.makeText(getApplicationContext(), "Your Location is - \nLat: " + phoneLatitude + "\nLong: " + phoneLongitude, Toast.LENGTH_LONG).show();
			    
				return true;
			}
			case R.id.menu_ncResHall:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (NORTH_RESIDENCE_HALL)
					.title(this.getString(R.string.menu_ncResHall)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_ucGallery:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (UG_GALLERY)
					.title(this.getString(R.string.menu_ucGallery)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_ffResHall:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (FRANK_FRANZ)
					.title(this.getString(R.string.menu_ffResHall)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_confCenter:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (CC_HOTEL)
					.title(this.getString(R.string.menu_confCenter)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_univCenter:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (UNIVERSITY_CENTER)
					.title(this.getString(R.string.menu_univCenter)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_ccResHall:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (CC_RESIDENCE_HALL)
					.title(this.getString(R.string.menu_ccResHall)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_wilsonHall:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (WILSON)
					.title(this.getString(R.string.menu_wilsonHall)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_baBuilding:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (BA)
					.title(this.getString(R.string.menu_baBuilding)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_library:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (LIBRARY)
					.title(this.getString(R.string.menu_library)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_robertsHall:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (ROBERTS)
					.title(this.getString(R.string.menu_robertsHall)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_nursingBuilding:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (NURSING)
					.title(this.getString(R.string.menu_nursingBuilding)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_soccerField:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (SOCCER)
					.title(this.getString(R.string.menu_soccerField)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_univFitCenter:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (FITNESS_CENTER)
					.title(this.getString(R.string.menu_univFitCenter)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_frat:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (FRAT)
					.title(this.getString(R.string.menu_frat)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_seCampusHousing:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (SE_HOUSING)
					.title(this.getString(R.string.menu_seCampusHousing)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_parking:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (PARKING_DECK)
					.title(this.getString(R.string.menu_parking)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_papaJohns:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (PAPA_JOHNS)
					.title(this.getString(R.string.menu_papaJohns)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_chargerVillage:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (CHARGER_VILLAGE)
					.title(this.getString(R.string.menu_chargerVillage)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_creditUnion:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (CREDIT_UNION)
					.title(this.getString(R.string.menu_creditUnion)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_optics:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (OPTICS)
					.title(this.getString(R.string.menu_optics)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_matScience:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (MATERIALS_SCIENCE)
					.title(this.getString(R.string.menu_matScience)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_admissions:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (ADMISSIONS)
					.title(this.getString(R.string.menu_admissions)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_eng:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (ENGINEERING)
					.title(this.getString(R.string.menu_eng)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_vonBraun:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (VON_BRAUN)
					.title(this.getString(R.string.menu_vonBraun)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_madisonHall:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (MADISON)
					.title(this.getString(R.string.menu_madisonHall)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_shelbyCenter:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (SHELBY)
					.title(this.getString(R.string.menu_shelbyCenter)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_shelbieKingHall:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (SHELBIE_HALL)
					.title(this.getString(R.string.menu_shelbieKingHall)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_techHall:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (TECH)
					.title(this.getString(R.string.menu_techHall)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_budCramerResearchHall:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (CRAMER)
					.title(this.getString(R.string.menu_budCramerResearchHall)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_spragins:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (SPRAGINS)
					.title(this.getString(R.string.menu_spragins)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_busServices:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (BUSINESS_SERVICES)
					.title(this.getString(R.string.menu_busServices)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_radio:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (RADIO)
					.title(this.getString(R.string.menu_radio)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_chan:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (AUDITORIUM)
					.title(this.getString(R.string.menu_chan)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_wilson:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (WILSON_THEATRE)
					.title(this.getString(R.string.menu_wilson)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_slab:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (SLAB)
					.title(this.getString(R.string.menu_slab)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_exhibitHall:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (EXHIBIT_HALL)
					.title(this.getString(R.string.menu_exhibitHall)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_bookstore:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (BOOKSTORE)
					.title(this.getString(R.string.menu_bookstore)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_admVisCenter:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (VISITORS_CENTER)
					.title(this.getString(R.string.menu_admVisCenter)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_studio:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (STUDIO_106)
					.title(this.getString(R.string.menu_studio)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			case R.id.menu_recitalHall:
			{
				myMap.clear();
				Marker marker = myMap.addMarker(new MarkerOptions()
					.position (RECITAL_HALL)
					.title(this.getString(R.string.menu_recitalHall)));
				marker.showInfoWindow();
				itemSelected = true;
				lastLocation = marker;
				return true;
			}
			default:
				return super.onOptionsItemSelected(item);
		}
	}
}
